Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(observability): utilise new logger in stats-web #462

Closed

Conversation

forbesus
Copy link
Contributor

ref #436

@forbesus forbesus requested a review from a team as a code owner November 12, 2024 02:24
@forbesus
Copy link
Contributor Author

would you check this pr? @ygrishajev

apps/stats-web/src/app/transactions/[hash]/page.tsx Outdated Show resolved Hide resolved
apps/stats-web/src/app/transactions/[hash]/error.tsx Outdated Show resolved Hide resolved
apps/stats-web/src/app/error.tsx Outdated Show resolved Hide resolved
apps/stats-web/src/app/blocks/[height]/errors.tsx Outdated Show resolved Hide resolved
apps/stats-web/src/lib/copyClipboard.ts Outdated Show resolved Hide resolved
apps/stats-web/src/lib/copyClipboard.ts Outdated Show resolved Hide resolved
apps/stats-web/src/lib/copyClipboard.ts Outdated Show resolved Hide resolved
apps/stats-web/src/lib/copyClipboard.ts Outdated Show resolved Hide resolved
packages/logging/src/servicies/logger/logger.service.ts Outdated Show resolved Hide resolved
apps/stats-web/src/app/blocks/[height]/errors.tsx Outdated Show resolved Hide resolved
@forbesus
Copy link
Contributor Author

all things are completed @ygrishajev

Copy link
Contributor

@ygrishajev ygrishajev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so how does it work with process.env and config within logger?

packages/logging/src/servicies/logger/logger.service.ts Outdated Show resolved Hide resolved
@forbesus
Copy link
Contributor Author

how about now? @ygrishajev

Copy link
Contributor

@ygrishajev ygrishajev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I have LOG_LEVEL=debug but it's not picked up by config in the browser. I think config needs to be provided to the LoggerService constructor.

packages/logging/src/servicies/logger/logger.service.ts Outdated Show resolved Hide resolved
packages/logging/src/servicies/logger/logger.service.ts Outdated Show resolved Hide resolved
@forbesus
Copy link
Contributor Author

so I have LOG_LEVEL=debug but it's not picked up by config in the browser. I think config needs to be provided to the LoggerService constructor.

i am not sure what this meaning exactly
could you tell me more detail?

@ygrishajev
Copy link
Contributor

@forbesus LOG_LEVEL is an env var

LOG_LEVEL: z.enum(["fatal", "error", "warn", "info", "debug", "trace"]).optional().default("info"),

which controls which logs are done. It is a great way to configure logger on the backend, but it wouldn't work in most frontend implementations.

So LoggerService should probably implement both env vars and config object as param in constructor.

@forbesus
Copy link
Contributor Author

how about now? @ygrishajev

@forbesus
Copy link
Contributor Author

please check again @ygrishajev

@forbesus
Copy link
Contributor Author

how about now? @ygrishajev

@forbesus forbesus force-pushed the feat/new-logger-stats-web branch 2 times, most recently from cca35e3 to 7c994da Compare November 26, 2024 09:48
@forbesus
Copy link
Contributor Author

hello @ygrishajev i just fixed this issue
would you check again?
thanks

packages/logging/src/servicies/logger/logger.service.ts Outdated Show resolved Hide resolved
packages/logging/src/config/env.config.ts Outdated Show resolved Hide resolved
apps/stats-web/next.config.js Outdated Show resolved Hide resolved
@ygrishajev
Copy link
Contributor

@forbesus I'm getting this error on the backend

stats-web-1  |  ⨯ Error: Cannot find module 'pino'
stats-web-1  | Require stack:
stats-web-1  | - /app/apps/stats-web/.next/server/app/_not-found/page.js
stats-web-1  |     at Object.pino (/app/apps/stats-web/.next/server/app/_not-found/page.js:176:18)
stats-web-1  |     at __webpack_require__ (/app/apps/stats-web/.next/server/webpack-runtime.js:33:43)
stats-web-1  |     at eval (../../packages/logging/src/servicies/logger/logger.service.ts:7:62)
stats-web-1  |     at (ssr)/../../packages/logging/src/servicies/logger/logger.service.ts (/app/apps/stats-web/.next/server/app/_not-found/page.js:775:1)
stats-web-1  |     at __webpack_require__ (/app/apps/stats-web/.next/server/webpack-runtime.js:33:43)
stats-web-1  |     at eval (../../packages/logging/src/index.ts:5:90)
stats-web-1  |     at (ssr)/../../packages/logging/src/index.ts (/app/apps/stats-web/.next/server/app/_not-found/page.js:764:1)
stats-web-1  |     at __webpack_require__ (/app/apps/stats-web/.next/server/webpack-runtime.js:33:43)
stats-web-1  |     at eval (./src/app/error.tsx:9:79)
stats-web-1  |     at (ssr)/./src/app/error.tsx (/app/apps/stats-web/.next/server/app/_not-found/page.js:324:1)
stats-web-1  |     at Object.__webpack_require__ [as require] (/app/apps/stats-web/.next/server/webpack-runtime.js:33:43)
stats-web-1  |     at JSON.parse (<anonymous>)
stats-web-1  |     at JSON.parse (<anonymous>)

@forbesus forbesus force-pushed the feat/new-logger-stats-web branch 3 times, most recently from 4d070b7 to 0d9930a Compare November 28, 2024 22:25
@forbesus
Copy link
Contributor Author

forbesus commented Dec 4, 2024

moved to #516

@forbesus forbesus closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants